import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home.vue'),
    children: [
      {
        path: '/index',
        name: 'index',
        component: () => import('../views/home/index.vue')
      },
      {
        path: '/course',
        name: 'course',
        component: () => import('../views/home/course.vue')
      },
      {
        path: '/record',
        name: 'record',
        component: () => import('../views/home/record.vue')
      }
      ,
      {
        path: '/practice',
        name: 'practice',
        component: () => import('../views/home/practice.vue')
      },
      {
        path: '/userIndex',
        name: 'userIndex',
        component: () => import('../components/user/userIndex.vue')
      },
    ]
  },
  {
    path: '/info',
    name: 'info',
    component: () => import('../components/user/info.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/home/login.vue')
  },
  {
    path: '/setPassword',
    name: 'setPassword',
    component: () => import('../views/home/setPassword.vue')
  },
  {
    path: '/option',
    name: 'option',
    component: () => import('../views/home/option.vue')
  },
  {
    path: '/custmoer',
    name: 'custmoer',
    component: () => import('../views/home/custmoer.vue'),
  }, {
    path: '/smslogin',
    name: 'smslogin',
    component: () => import('../views/home/smslogin.vue'),
  },
  {
    path: '/teach',
    name: 'teach',
    component: () => import('../views/teacher/teach.vue')
  },
  {
    path: '/concern',
    name: 'concern',
    component: () => import('../views/teacher/concern.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
